Skip to main content

Mark Notification Read

You can use the following function from the LikeMinds iOS SDK to mark the notifications that have been clicked by user in your application, as read.

Steps to mark a notification as read

  1. Create a MarkReadNotificationRequest object using MarkReadNotificationRequest.builder() class by passing all the required parameters.
  2. Call markReadNotification() function using the instance of LMFeedClient.
  3. Process the response LMResponse<NoData> as per your requirement.
// object of MarkReadNotificationRequest
let request = MarkReadNotificationRequest.builder()
.activityId("64824ce1167fe6ac068ad444") // id of the notification activity which is to be marked as read
.build()
LMFeedClient.shared.markReadNotification(request) { response in
// response (LMResponse<NoData>)
if (response.success) {
// your function to process the response data
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}

MarkReadNotificationRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
activityIdStringID of the notification activity which is to be marked as read.